﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlaceOrder_Core.Models.QuanYi
{
    public class QuanYiServerBaseClass
    {
        public enum DataTypeEnum
        {
            Login,//登录
            Logout,//登出
            Order,//下单
            Trade,
            Withdraw,//撤单中（等待中介反馈）
            Withdrawed,//已撤单
            ChangePrice,//改价中（等待中介反馈）
            ChangePriceConfirm,//改价确认
            UserStatusChange,//用户下单状态变更
            PrepareClosingTrading,
            CloseTrading,
            Ping,
            ChatMessage,
            NewChatMessageIn,//收到新消息
            BackdatedOrder,
            InitChatMessage,
            Deal,
            RequestReview, //申请复议
            PingCang, //平仓
            ShakeWindow, //窗口抖动
            QTradeNotOpen //QTrade未开启
        }
        public QuanYiServerBaseClass()
        {

        }
        public QuanYiServerBaseClass(QuanYiServerBaseClass qsr)
        {
            /// <summary>
            /// Code Def:
            /// 0: No Error;
            /// 1: Token Expires;
            /// 2: Change Price Failed;
            /// 3: Withdraw Failed;
            /// 4: Volume exceeded;
            /// 5: Timeout;
            /// 6: Order Failed:Lily Order creating failed
            /// 7: Order Failed:BondHelper Order creating failed
            /// 8: Order Already exists
            /// 9: User disabled
            /// 10: No Free Agency
            /// 11：改价重定向？
            /// 99: Unknown Error;
            /// </summary>
            Code = qsr.Code;
            Message = qsr.Message;
            UserID = qsr.UserID;
            DataType = qsr.DataType;
            Token = qsr.Token;
            Guid = qsr.Guid;
        }

        public int Code { get; set; }
        public string Message { get; set; }
        public int UserID { get; set; }
        public DataTypeEnum DataType { get; set; }
        public string Token { get; set; }
        public Guid Guid { get; set; }
        public string RemoteIP { get; set; }
        public Guid SessionID { get; set; }
    }
}
